import { mapActions, mapMutations } from 'vuex';
const ACTION_PREFIX = module.id; // 设置action前缀确保type的唯一性

export const setDynamicList = `${ACTION_PREFIX}/setDynamicList`;
export const setCommunityDetailData = `${ACTION_PREFIX}/setCommunityDetailData`;
export const setCommunityDetailCommentListData = `${ACTION_PREFIX}/setCommunityDetailCommentListData`;
export const setDetailCommentReplyData = `${ACTION_PREFIX}/setDetailCommentReplyData`;
export const updateCommunityDetailDataCommentList = `${ACTION_PREFIX}/updateCommunityDetailDataCommentList`;
export const updateCommunityDetailDataCommentListReply = `${ACTION_PREFIX}/updateCommunityDetailDataCommentListReply`;
export const upDateArticleDetailCommentListLike = `${ACTION_PREFIX}/upDateArticleDetailCommentListLike`;
export const setUserPersonListInformationData = `${ACTION_PREFIX}/setUserPersonListInformationData`;
export const setUserPersonDynamicDraftData = `${ACTION_PREFIX}/setUserPersonDynamicDraftData`;
export const setArticleShareQrcode = `${ACTION_PREFIX}/setArticleShareQrcode`;
export const setHomeAd = `${ACTION_PREFIX}/setHomeAd`;
export const setHomeQuickEntry = `${ACTION_PREFIX}/setHomeQuickEntry`;
export const UPDATE_LIST_VIEW_COMMENT_LIKE_ARTICLE = `${ACTION_PREFIX}/UPDATE_LIST_VIEW_COMMENT_LIKE_ARTICLE`;
export const UPDATE_DELETE_ARTICLE = `${ACTION_PREFIX}/UPDATE_DELETE_ARTICLE`;
export const mutations = mapMutations({
	upDateListvuewCommentLikeArticle: UPDATE_LIST_VIEW_COMMENT_LIKE_ARTICLE,
	upDateDeleteArticle: UPDATE_DELETE_ARTICLE,
})

export const GET_HOME_AD = `${ACTION_PREFIX}/GET_HOME_AD`;
export const GET_HOME_QUICK_ENTRY = `${GET_HOME_QUICK_ENTRY}/GET_HOME_AD`;
export const LOAD_DYNAMIC_LIST = `${ACTION_PREFIX}/LOAD_DYNAMIC_LIST`;
export const LOAD_COMMUNITY_DETAIL_DATA = `${ACTION_PREFIX}/LOAD_COMMUNITY_DETAIL_DATA`;
export const LOAD_COMMUNITY_PREVIEW_DETAIL_DATA = `${ACTION_PREFIX}/LOAD_COMMUNITY_PREVIEW_DETAIL_DATA`;
export const LOAD_COMMUNITY_DETAIL_COMMENT_LIST = `${ACTION_PREFIX}/LOAD_COMMUNITY_DETAIL_COMMENT_LIST`;
export const LOAD_DETAIL_COMMENT_REPLY_LIST = `${ACTION_PREFIX}/LOAD_DETAIL_COMMENT_REPLY_LIST`;
export const LOAD_MORE_DETAIL_COMMENT_REPLY_LIST = `${ACTION_PREFIX}/LOAD_MORE_DETAIL_COMMENT_REPLY_LIST`;

export const INSERT_ARTICLE_COMMENT = `${ACTION_PREFIX}/INSERT_ARTICLE_COMMENT`;
export const DELETE_ARTICLE_COMMENT = `${ACTION_PREFIX}/DELETE_ARTICLE_COMMENT`;
export const INSERT_ARTICLE_COMMENT_REPLY = `${ACTION_PREFIX}/INSERT_ARTICLE_COMMENT_REPLY`;
export const DELETE_ARTICLE_COMMENT_REPLY = `${ACTION_PREFIX}/DELETE_ARTICLE_COMMENT_REPLY`;
export const REPORT_ARTICLE = `${ACTION_PREFIX}/REPORT_ARTICLE`;
export const DELETE_ARTICLE = `${ACTION_PREFIX}/DELETE_ARTICLE`;
export const GET_ARTICLE_SHARE_QRCODE = `${ACTION_PREFIX}/GET_ARTICLE_SHARE_QRCODE`;
export const ARTICLE_SHARE_ADD = `${ACTION_PREFIX}/ARTICLE_SHARE_ADD`;

export const UPDATE_LIKE_ARTICLE = `${ACTION_PREFIX}/UPDATE_LIKE_ARTICLE`;
export const UPDATE_LIKE_COMMENT = `${ACTION_PREFIX}/UPDATE_LIKE_COMMENT`;
export const UPDATE_LIKE_COMMENT_REPLY = `${ACTION_PREFIX}/UPDATE_LIKE_COMMENT_REPLY`;

export const GET_USER_PERSON_LIST_INFORMATION = `${ACTION_PREFIX}/GET_USER_PERSON_LIST_INFORMATION`;
export const INSERT_USER_PERSON_DYNAMIC = `${ACTION_PREFIX}/INSERT_USER_PERSON_DYNAMIC`;
export const GET_USER_PERSON_DYNAMIC_DRAFT = `${ACTION_PREFIX}/GET_USER_PERSON_DYNAMIC_DRAFT`;

export default mapActions({
	getHomeAd: GET_HOME_AD,
	getHomeQuickEntry: GET_HOME_QUICK_ENTRY,
	loadDynamicList: LOAD_DYNAMIC_LIST,
	loadCommunityDetailData: LOAD_COMMUNITY_DETAIL_DATA,
	loadCommunityPreviewDetailData: LOAD_COMMUNITY_PREVIEW_DETAIL_DATA,
	loadCommunityDetailCommentList: LOAD_COMMUNITY_DETAIL_COMMENT_LIST,
	loadDetailCommentReplyList: LOAD_DETAIL_COMMENT_REPLY_LIST,
	loadMoreDetailCommentReplyList: LOAD_MORE_DETAIL_COMMENT_REPLY_LIST,
	//
	insertArticleComment: INSERT_ARTICLE_COMMENT,
	deleteArticleComment: DELETE_ARTICLE_COMMENT,
	insertArticleCommentReply: INSERT_ARTICLE_COMMENT_REPLY,
	deleteArticleCommentReply: DELETE_ARTICLE_COMMENT_REPLY,
	reportArticle: REPORT_ARTICLE,
	deleteArticle: DELETE_ARTICLE,
	getArticleShareQrcode: GET_ARTICLE_SHARE_QRCODE,
	articleShareAdd: ARTICLE_SHARE_ADD,
	//
	updateLikeArticle: UPDATE_LIKE_ARTICLE,
	updateLikeComment: UPDATE_LIKE_COMMENT,
	updateLikeCommentReply: UPDATE_LIKE_COMMENT_REPLY,
	//
	getUserPersonListInformation: GET_USER_PERSON_LIST_INFORMATION,
	insertUserPersonDynamic: INSERT_USER_PERSON_DYNAMIC,
	getUserPersonDynamicDraft: GET_USER_PERSON_DYNAMIC_DRAFT,
})